package com.muke.dto;

import com.muke.entity.SuccSecKill;
import com.muke.enums.SecKillEnums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * @ClassName SecKillExecution 执行秒杀操作执行结果
 * @Description: TODO
 * @Author hezx
 * @Date 2019-10-9
 * @Version V1.0
 **/
@Getter
@Setter
@ToString
public class SecKillExecution {

    //操作ID
    private Long secKillId;

    //执行状态
    private Integer state;

    //执行状态信息
    private String stateInfo;

    //执行结果
    private SuccSecKill succSecKill;

    public SecKillExecution(Long secKillId, SecKillEnums enums) {
        this.secKillId = secKillId;
        this.state = enums.getState();
        this.stateInfo = enums.getStateInfo();
    }

    public SecKillExecution(Long secKillId, SecKillEnums enums, SuccSecKill succSecKill) {
        this.secKillId = secKillId;
        this.state = enums.getState();
        this.stateInfo = enums.getStateInfo();
        this.succSecKill = succSecKill;
    }
}
